//将所有的路由数组进行独立封装
export const constRouter = [
  {
    //登陆页面
    path: "/login", //访问地址
    component: () => import("@/views/login/index.vue"), // 动态路由
    name: "login", //命令路由，用来后期权限处理
    meta: {
      title: "登录",
      hidden: false,
      icon: "Link",
    },
  },
  {
    //数据展示页面
    path: "/", //访问地址
    component: () => import("@/views/layout/index.vue"), // 动态路由
    name: "welcome", //命令路由，用来后期权限处理
    meta: {
      title: "layout",
      hidden: true,
      icon: "HomeFilled",
    },
    redirect: "/home",
    children: [
      {
        path: "/home",
        component: () => import("@/views/home/index.vue"),
        meta: {
          title: "首页",
          hidden: true,
          icon: "HomeFilled",
        },
      },
    ],
  },
  //权限管理
  {
    path: "/acl",
    name: "Acl",
    //注意一下Acl也是一级路由，采用的也是layout结构，所以这里点击/acl时也是调用layout
    component: () => import("@/views/layout/index.vue"),
    meta: {
      title: "权限管理",
      hidden: true,
      icon: "Lock",
    },
    redirect: "/acl/user",
    children: [
      {
        path: "/acl/user",
        component: () => import("@/views/acl/user/index.vue"),
        name: "User",
        meta: {
          title: "用户管理",
          hidden: true,
          icon: "User",
        },
      },
      {
        path: "/acl/role",
        component: () => import("@/views/acl/role/index.vue"),
        name: "Role",
        meta: {
          title: "角色管理",
          hidden: true,
          icon: "Avatar",
        },
      },
      {
        path: "/acl/permission",
        component: () => import("@/views/acl/permission/index.vue"),
        name: "Permission",
        meta: {
          title: "菜单管理",
          hidden: true,
          icon: "Tools",
        },
      },
    ],
  },
];
